package com.mayikt.days08;

import com.mayikt.days07.OrderEntity;

import java.lang.ref.WeakReference;
import java.util.HashMap;

/**
 * @ClassName Test003
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test003 {
    public static void main(String[] args) {
        OrderEntity o1 = new OrderEntity("644064779", "每特教育66");
//        OrderEntity o2 = o1;
//        o1=null;
//        System.out.println(o2);
//        System.gc();
//        System.out.println(o2);
//        WeakReference<OrderEntity> o2 = new WeakReference<>(o1);
//        o1 = null;
//        System.out.println("o2:" + o2.get());
//        System.gc();
//        System.out.println("o2:" + o2.get());

        HashMap<Thread, String> threadStringHashMap = new HashMap<>();
        threadStringHashMap.put(Thread.currentThread(), "mayikt");
        System.out.println(threadStringHashMap.get(Thread.currentThread()));
    }
}
